#ifndef __key_h   
#define __key_h
//HAL--------------------
	#define D_keyGongNeng  P1_0	
	#define D_keyJian  P3_0	
	#define D_keyJia  P1_1	
	#define D_keyQueRen  P3_6	
	//#define P_key5  P3_3	

        
//Const--------------------
  #define D_keyCount  4
   #define F_setKeyMode()  P1MODL &=b1111_0000;  P3MODL &=b1111_1100;  P3MODH &=b1100_1111;D_keyGongNeng=1; D_keyJian=1; D_keyJia=1;  D_keyQueRen=1;\
   PINMOD &=b1111_0011;  PINMOD|=b0000_0100;\ 
   P1MODL &=b1100_1111;  P1MODL|=b0001_0000;\
   P3MODL &=b1100_1111;	 P3MODL|=b0001_0000;\
   F_lockComs();\
   //F_lockSegs();
//Var----------------------
 #ifdef __key_c
    uint8_t keyValue;
    uint8_t keyBuf[D_keyCount]={0xff,0xff,0xff,0xff};
    uint8_t keySta[D_keyCount]={1,1,1,1};
    uint8_t backUp[D_keyCount]={1,1,1,1};
   
 #else
    extern  uint8_t keyValue;
    extern  uint8_t keyBuf[D_keyCount];
    extern  uint8_t keySta[D_keyCount];
    extern  uint8_t backUp[D_keyCount];
   
    
 
 #endif
   

//Function----------------------

void GetKey();
void KeyJudge();
#endif